#ifndef _SKY_H_
#define _SKY_H_

#include "d3dUtil.h"
#include "Effects.h"
#include "InputLayouts.h"
#include "Camera.h"



struct SkyVertex
{
	D3DXVECTOR3 pos;
};



class Sky
{
public:
	Sky() : mD3dDevice(0), mVertexBuffer(0), mIndexBuffer(0), mNumIndices(0),
		mCubeMap(0),
		mTech(0), mfxWVPVar(0), mfxCubeMapVar(0)
	{
	}
	virtual ~Sky() {
		ReleaseCOM(mVertexBuffer);
		ReleaseCOM(mIndexBuffer);
	}

	void init(ID3D10Device *device, float radius);
	void update(float dt);
	void draw();

private:
	ID3D10Device *mD3dDevice;
	ID3D10Buffer *mVertexBuffer;
	ID3D10Buffer *mIndexBuffer;
	DWORD mNumIndices;

	ID3D10ShaderResourceView *mCubeMap;

	ID3D10EffectTechnique			*mTech;
	ID3D10EffectMatrixVariable		*mfxWVPVar;
	ID3D10EffectShaderResourceVariable *mfxCubeMapVar;

	void buildBuffers(float radius);
};



#endif//_SKY_H_
